package com.huxianyang.config;

import com.huxianyang.converter.String2UserConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 
 * @since 2022/06/01 21:12
 * @author HuXianyang
 */
// @Configuration
public class Converter2Configuration implements WebMvcConfigurer {

    @Autowired
    String2UserConverter string2UserConverter;

    @Override
    public void addFormatters(FormatterRegistry registry) {
        registry.addConverter(new String2UserConverter());
    }
}